package com.msb.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

/**
 * @author sunpeng
 * @Date 2021-06-07 11:29
 */
@Controller
public class User {

    @GetMapping("/login")
    public ModelAndView login(){
        System.out.println("this is login");

        ModelAndView mv = new ModelAndView();
        Map<String, Object> model = mv.getModel();
        model.put("msg", "脏话，你好");
        mv.setViewName("/success.jsp");

        //int i = 1/0; //即使异常，过滤器中的afterCompletion任然会执行
        return mv;
    }
}
